package swing;

import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JToggleButton;
import javax.swing.border.Border;

public class Layout {

	private JFrame frame;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Layout window = new Layout();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
	
	
	/**
	 * Create the application.
	 */
	public Layout() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 450, 300);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		JToggleButton but1 = new JToggleButton("已选中",true);
		JToggleButton but2 = new JToggleButton("未选中");
		JToggleButton but3 = new JToggleButton("按我");
		frame.setLayout(new GridLayout(3,1));
		frame.add((but1),BorderLayout.EAST);
		frame.add((but2),BorderLayout.WEST);
		frame.add((but3),BorderLayout.CENTER);
		frame.setSize(200,100);
		frame.setLocation(300,200);
		frame.setVisible(true);
	}
}
